Reclaim local data when a localized version is deleted - #2831
Draft
francoisferrand wants to merge 3 commits into
Draft
Reclaim local data when a localized version is deleted#2831francoisferrand wants to merge 3 commits into
francoisferrand wants to merge 3 commits into
Conversation
Data sitting on an isCRR location is production data owned by a remote site: we may read it, but deleting it is never ours to do. The copy engine reuses the lifecycle transition pipeline, which garbage-collects the from-location once the new one is merged into the metadata - against an isCRR source that would wipe the remote production copy. Unlike a transition, a localization merge must therefore leave the from-location alone. Keying this on the location type rather than making it a clean-room special case also gives us replay safety for duplicate copy actions: the second merge supersedes the first and collects its copy, which is only safe because the first never touched the remote source. Issue: BB-813
Same no-GC rule as in the copy engine, applied where data actually gets deleted: whatever published the deleteData action, parts living on an isCRR location are remote production data and get skipped rather than deleted. That covers every publisher, notably restored-object expiration, where expiring a clean-room object that was never localized would otherwise delete the production copy. Reaching the GC service with such a location means something upstream is wrong, so it warns, but deleting is never the right answer: the entry is still completed and the offset committed, and no completion metric is emitted for a delete that did not happen. Issue: BB-818
In a clean room the bucket location constraint is the isCRR source location, so once an object has been localized its metadata looks exactly like a transitioned object: the mongo processor was bailing out with "transitioned to another location", never deleting the metadata and leaving the local copy of the data behind forever. Detect that case and, after the metadata delete, publish a deleteData action for the local parts only. Versions which were never localized still point at the isCRR location and are left alone, as before. Issue: BB-815
Contributor
Hello francoisferrand,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Contributor
Codecov Report❌ Patch coverage is Additional details and impacted files
... and 4 files with indirect coverage changes
@@ Coverage Diff @@
## development/9.6 #2831 +/- ##
===================================================
- Coverage 75.77% 75.61% -0.16%
===================================================
Files 200 201 +1
Lines 13922 13972 +50
===================================================
+ Hits 10549 10565 +16
- Misses 3363 3397 +34
Partials 10 10
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
francoisferrand
changed the base branch from
development/9.6
to
improvement/BB-813
August 24, 2026 11:44
francoisferrand
force-pushed
the
improvement/BB-813
branch
5 times, most recently
from
September 8, 2026 07:50
226a14c to
777d6f9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #2828 (BB-813/BB-818) - review that one first.
In a clean room the bucket location constraint is the isCRR source location, so once an object has been localized its metadata looks exactly like a transitioned object:
dataStoreNameandlocation[0]point at the local location instead of the bucket's location. The mongo processor took that as "transitioned to another location" and skipped the delete entirely, so the version stayed in mongo forever and the local copy of the data was never reclaimed.The processor now recognizes that case: when the bucket location is an isCRR location, any location part that is not on an isCRR location means the object was localized. Those parts are the ones we own, so the delete goes through and a
deleteDataaction is published for them right after the metadata is removed (that ordering means a failure leaks data rather than losing it). Versions that were never localized still have all their parts on the isCRR location, so nothing is published and the existing behaviour is untouched.Note there is no config flag for this: outside of a clean room there simply are no isCRR locations, so the new branch is unreachable.
Issue: BB-815